import request from '@/common/request'


/**
 * 用户登录
 * @param data object 用户账号密码
 */
export function login(data) {
	return request.post('/login', data, {
		login: false,
	})
}


/*
 * 用户信息
 * */
export function getUserInfo() {
	return request.get('/getInfo', {
		login: true,
	})
}

/**
 * 获取我的收入
 */
export function getMyIncome(pageNum, pageSize) {
	return request.get('/business/balances', {
		pageNum,
		pageSize
	})
}

/**
 * 获取业绩
 */
export function getAchievementInfo() {
	return request.get('/business/performance', {
		login: true,
	})
}

/*
 * 获取业绩页订单列表
 * 
 */
export function getBusinessOrderList(pageNum, pageSize) {
	return request.get('/business/list', {
		pageNum: pageNum,
		pageSize: pageSize
	})
}

/*
 * 获取客户管理营业数据分析
 * */
export function getMerchantData(type) {
	return request.get('/business/turnover', {
		type: type,
	})
}

/*
 * 客户列表
 * 
 */
export function getMerchantList(pageNum, pageSize) {
	return request.get('/business/members', {
		pageSize,
		pageNum
	})
}

/**
 * 商家经营概况  
 * @param {Object} id
 * @param {Object} type
 */
export function getMerchantDetail(id, type) {
	return request.get('/business/memberInfo', {
		id,
		type
	})
}

/*
 * 订单详情
 * 
 */
export function orderDetail(id) {
	return request.get('/business/info', {
		id,

	})
}

/**
 * 商户名单明细
 */
export function getMerchantOrderList(id, pageNum, pageSize) {
	return request.get('/business/list', {
		memberId: id,
		pageNum,
		pageSize
	})
}


/**
 * 巡店记录
 */
export function getShopVisitRecord(id, pageNum, pageSize) {
	return request.get('/business/visits', {
		id: id,
		pageNum,
		pageSize
	})
}


/**
 * 获取任务列表
 * @param {Object} type
 */
export function getTaskList(type, time, pageNum, pageSize) {
	return request.get('/business/task', {
		status: type,
		time,
		pageNum,
		pageSize
	})
}


/**
 * 创建任务
 * @param {Object} data
 */
export function createTask(data) {
	return request.post('/business/task', data, {

	})
}

/**
 * 提交任务
 * @param {Object} data
 */
export function submitTask(data) {
	return request.post('/business/submitTask', data, {

	})
}

/**
 * 任务详情
 * @param {Object} id
 */
export function getTaskInfo(id) {
	return request.get('/business/taskInfo', {
		id: id,
	})
}

/**
 * 完成任务
 * @param {Object} data
 */
export function finishTask(data) {
	return request.post('/business/submitTask', data, {

	})
}

/**
 * 批量分拣
 * @param {Object} id
 */
export function oneKeySort(goodsId) {
	return request.get('/sxsd/orderSorting/wxbatch', {
		goodsId: goodsId
	})
}

/**
 * 批量分拣
 * @param {Object} id
 */
export function disKeySort(goodsId) {
	return request.get('/sxsd/warehouseSorting/wxbatch', {
		goodsId: goodsId
	})
}

/**
 * 审核
 * @param {Object} data
 */
export function Audit(data) {
	return request.post('/business/audit', data, {

	})
}